

GFXSurface
----------
Size: 0x78 - 0x80
Max Size: 0x80  [See GFXMemSurface below]

Offset	Size	Description
------	----	-----------
0x0	4	vtbl
0x4	4	int flags
0x8	4	
0xC	4	
0x10	4	int maxX			[width - 1]
0x14	4	int maxY			[height - 1]
0x18	4	
0x1C	4	
0x20	4	
0x24	4	
0x28	4	
0x2C		
0x30	4	Palette?*
0x34	4	void* imageBuffer		[Locked]
0x38	4	int pitch			[Locked]  [RoundUpM4((bpp/8) * width)]
0x3C	4	int width			[(wndWidth/zoom)/2*2]
0x40	4	int height			[(wndHeight/zoom)]
0x44	4	int bitDepth			[16]	
0x48	4	
0x4C	4	
0x50	4					[... 1]
0x54	4	
0x58	4	
0x5C	4	
0x60	4	
0x64	4	int imageBufferLockCount	[imageBuffer*, pitch]
0x68	4	int memoryDCLockCount		[hSrcDC]
0x6C	4	HDC hMemDC			[MemoryDC]  [Copied from 0x84 on lock]
0x70	4	
0x74	4	



GFXSurface:GFXMemSurface
------------------------
Size: 0x80

Offset	Size	Description
------	----	-----------
0x78	4	???*				[Bitmap info struct]
0x7C	4	



GFXSurface:GFXCDSSurface
------------------------
Min Size: 0xB0
------------------------
0x78	4	HBITMAP hDibSection		[Selected into Memory DC]  [Size: ((wndWidth/zoom)/2*2) x (wndHeight/zoom)]
0x7C	4	void* pBits			[Returned by CreateDibSection]
0x80	4	HDC hDestDC			[Window DC]
0x84	4	HDC hSrcDC			[Memory DC]
0x88	4	HPALETTE hNewPalette		[Selected into Window DC]
0x8C	4	HPALETTE hOldPalette		[Returned from Window DC]
0x90	4	HBITMAP hOldDibSection		[Returned from Memory DC]
0x94	4	HWND hDestWnd			[Destination Window]
0x98	0x18	


GFXSurface:GFXCDSSurface:GFXClippedSurface
-------------------------------------------
Base Class Min Size: 0xB0
Max Size: 0x95C
-------------------------------------------
Offset	Size	Description
------	----	-----------
0xB0	0x10	Rect drawRect			[Draw region to Window DC]
 0xB0	 4	 int x1
 0xB4	 4	 int y1
 0xB8	 4	 int x2
 0xBC	 4	 int y2	
0xC0	4	bool bScreenRequiresUpdate
0xC4	4	bool ???
0xC8	0x2C	BITMAPINFO bitmapInfo
 0xC8	 0x28	 BITMAPINFOHEADER bmiHeader
  0xC8	  4	  DWORD biSize
  0xCC	  4	  LONG biWidth
  0xD0	  4	  LONG biHeight
  0xD4	  2	  WORD biPlanes
  oxD6	  2	  WORD biBitCount
  0xD8	  4	  DWORD biCompression
  0xDC	  4	  DWORD biSizeImage
  0xE0	  4	  LONG biXPelsPerMeter
  0xE4	  4	  LONG biYPelsPerMeter
  0xE8	  4	  DWORD biClrUsed
  0xEC	  4	  DWORD biClrImportant
 0xF0	 4	 RGBQUAD[1] bmiColors
0xF4	4	BITMAPINFO* pBitmapInfo  	[Points to +0xC8]
0xF8	0x10	Rect redrawRect			[Clip Draw to back buffer]
 0xF8	 4	 int x1				[0]
 0xFC	 4	 int y1				[0]
 0x100	 4	 int x2				[width - 1]
 0x104	 4	 int y2				[height - 1]
0x108	4	???* 
0x10C	4	int zoom
0x110	0x84C	Viewport
-----



Viewport
--------
Size: 0x84C
Max Size: 0x84C  [Based on size of above container object]
Min Size: 0x84C  [Based on max seen offset from object pointer]

Offset	Size	Description
------	----	-----------
0x0	4	
0x4	4	int redrawBackgroundBitVectorLineWidth
0x8	4	int redrawBackgroundBitVectorSize
0xC	4	
0x10	4	
0x14	4	int height			[GFXSurface.height]
0x18	4	int width			[GFXSurface.width]
0x1C		
0x20	4	
0x24	4	int relativeRectTileLeft
0x28	4	int relativeRectTileTop
0x2C	4	int relativeRectTileRight
0x30	4	int rectTileHeight
-----				
0x34		
-----		
0x1C4		
-----		
0x354		
-----		
0x4E4		
-----		
0x674		
-----		
0x804	4	
0x808	4	char* redrawBackgroundBitVector  [+0x34  main view?]
0x80C	4	char* ???			 [+0x1C4 ???]
0x810	4	char* redrawBackgroundBitVector  [+0x4E4 mini map?/other?]
0x814	4	char* ???			 [+0x674 ???]
0x818	4	bool?
0x81C	4	int tileWidth	[Account for fractional tile scroll position]
0x820	4	int tileHeight	[Account for fractional tile scroll position]
0x824	4	GFXSurface* surface
0x828	4					 [-100000]
0x82C	4	
0x830	4	int pixelX  [of main view left edge]
0x834	4	int pixelY  [of main view top edge]
0x838	4	int tileStartPixelOffsetX	[0 .. -31]
0x83C	4	int tileStartPixelOffsetY	[0 .. -31]
0x840	4	int tileX   [of main view left edge]
0x844	4	int tileY   [of main view top edge]
0x848	4	
------



ScanlineCopyInfo
----------------
0x0	4	short[256]* palette
0x4	4	void* sourceImageBuffer
0x8		
0xC	4	void* destImageData
0x10	4	int width


BitmapCopyInfo
--------------
0x0	4	void* sourceImageBuffer
0x4	4	void* destImageBuffer
0x8	4	void* overlayMask		[blight or day and night]
0xC	4	int overlayMaskBitOffset
0x10	4	int sourceWidth
0x14	4	int sourceHeight
0x18	4	int sourcePitch
0x1C	4	int destPitch
0x20	4	enum DrawMethod drawMethod
0x24	4	short[256]* darkPal16		[current light level]
0x28	4	int blightOverlay		[0..15]
0x2C	4	short[256]* lightPal16		[full daylight]
---------------


enum DrawMethod
---------------

[Draw Background]
0	DrawScanline8Pal16
1	DrawScanline8Pal16MaskedBlightDither
2	DrawScanline8Pal16DayNightTransition
3	DrawScanlineFadeDestSourceFadeMask
4	DrawScanlineCopy16Raw
5	DrawScanlineCopy16Raw
6	DrawScanlineCopy16Raw
7	DrawScanlineCopy16Raw
8	DrawScanlineFadeDestSourceFadeMask
15	DrawScanline8Pal16FullBlightDither

[Draw Sprite]
0	DrawScanline8Pal16Transparent0
1	DrawScanline8Pal16DayNightTransitionTransparent0
2	DrawScanline8Pal16DayNightTransitionTransparent0
3	DrawScanlineFadeDestSourceFadeMask
